package com.atgui.yygh.controller;

import com.atgui.yygh.service.DepartmentService;
import com.atgui.yygh.vo.hosp.DepartmentVo;
import com.atguigu.yygh.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * zz: wzh
 * time 2022 09 05 14 07
 **/
@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("查询所有科室列表")
    @GetMapping("/getDepList/{hoscode}")
    public Result getDepList(@PathVariable String hoscode){
        List<DepartmentVo> list=departmentService.findDepTree(hoscode);
        return Result.ok(list);
    }
}
